source entropy.tcl

set nsample 10000
set nvar 6
time {
   set c_phi [ doublesToByteArray {1.57 1.57 1.57 1.57 1.57 1.57}]
   set c_k [ doublesToByteArray {10 15 15 12 12 14 } ]
   set c_lamda [doublesToByteArray {10 12 -8 }]
   set data {}
   for {set i 0} {$i< [expr [llength {1.0 1.0 1.0 1.0 1.0 1.0}]*$nsample]} { incr i} { lappend data 0.0 }
   set c_data [doublesToByteArray $data]
   gendata2 $nsample 3 $c_phi $c_k $c_lamda $c_data
   set data [byteArrayToDoubles $c_data]
   set sucessful success
}
#puts "v1 v2 v3 v4 v5 v6"
set datafile [open "new.dat" w]
foreach {v1 v2 v3 v4 v5 v6} $data {
  puts $datafile "$v1 $v2 $v3 $v4 $v5 $v6"
}
close $datafile
#calc entropy from generated sample

time {
MIE_NN  { 0 1 2 3 4 5 } 2 data $nsample 6 10
}

time {
MIE_hist {0 1 2 3 4 5 } 1 data $nsample 6 0.0 
}
